_weapon = param[0, ""];
diag_log "M4_fnc_getWeaponType";
if(typeName _weapon == "ARRAY") then
{ _weapon = _weapon select 0; };

_type = getNumber (configFile >> "CfgWeapons" >> _weapon >> "Type");

_type